Track downloaded streams and surface status on video detail#12639
Track downloaded streams and surface status on video detail#12639jmandel wants to merge 3 commits intoTeamNewPipe:refactorfrom
Conversation
|
Thank you for this cool PR! I have some general comments:
|
|
Hey thank you for the encouraging feedback! I figured it was good to get a rough demo in shape before spending time on anything else. (This pass was planned by GPT-5 Pro with limited access to the source code which is probably why I overlooked the existing table ;) I'm setting the PR to draft and will bring it back for review when I have addressed your feedback.) |
206170f to
159e7bb
Compare
|
Oh, I see. If you use LLMs to make contributions to open source projects, I strongly suggest making sure you only use LLMs as a companion to get some help, not to blindly generate code, as the latter just creates unneeded review work for maintainers (which would be able to use LLMs themselves if they really wanted to). |
Restore finshed mission conditoina
|
Definitely doing the best I can to get up to speed on a new codebase. I haven't done much android development in the kotlin era :) (Meta-level perspective: deciding what problems are worth tackling, coming up with a design, implementing it, and testing all still require significant nvestment, even with help from LLMs, so I'm not sure "maintainers would just use LLMs to do it all themselves if they wanted to" entirely holds -- e.g., #7360 has been open for almost 4 years, and I think I've made decent progress with 3-4 hours of my own time investment, plus your generous feedback + advice here. For me, part of the joy of open source is letting users learn, propose, and contribute things they care about.) That said: I don't want to waste your time if you're not interested in this contribution -- it's your project, your rules, @Stypox! I've updated this PR to address your initial feedback, but please let me know if you'd prefer to close the PR vs continuing a review cycle. |
Stypox
left a comment
There was a problem hiding this comment.
@jmandel I'm sorry if my comment came off as rough, I didn't mean to demonize your work. I just wanted to make sure I wasn't just reviewing LLM code. I agree that "coming up with a design, implementing it, and testing all still require significant investment", and it's fine to use LLMs to quickly get up-to-speed with a codebase. But it's not good practice to open a PR just from the output of vibe coding, but it does not seem like this is what happened here, so no worries. I'm happy to continue with the reviews :-)
Could you add a few comments in the code explaining how the data flows from the various places? E.g. in DownloadStatusRepository, explain why the binding setup is needed, why its implementation is correct, and which parts are important to get right.
app/src/main/res/values/strings.xml
Outdated
| <string name="download_open_failed">Unable to open downloaded file</string> | ||
| <string name="download_folder_open_failed">Unable to open folder</string> | ||
| <string name="download_delete_failed">Unable to delete downloaded file</string> | ||
| <string name="download_deleted">Deleted downloaded file</string> |
There was a problem hiding this comment.
I'm pretty sure most of these strings already exist, they are being used in the DownloadActivity, which I suggest you take a look at since most of the features you are implementing are already implemented there.
There was a problem hiding this comment.
Removed the bespoke strings from strings.xml and switched the UI to the existing downloader vocabulary (missing_file, delete_file, delete_entry, etc.), so the detail sheet stays consistent with DownloadActivity.
| } | ||
|
|
||
| @Nullable | ||
| private String buildQualityLabel(@NonNull final Stream stream) { |
There was a problem hiding this comment.
Instead of duplicating code, could you create a common function and also use it in https://github.com/TeamNewPipe/NewPipe/blob/dev/app/src/main/java/org/schabi/newpipe/util/StreamItemAdapter.java#L113 ?
There was a problem hiding this comment.
Created StreamLabelUtils.getQualityLabel(...) and replaced both the dialog helper and the adapter text formatting with calls to that function.
| data object None : DownloadStatus | ||
| data class InProgress(val running: Boolean) : DownloadStatus |
There was a problem hiding this comment.
Why don't None and InProgress also have CompletedDownload info? Isn't that info also available there?
There was a problem hiding this comment.
Introduced a unified DownloadEntry data class that carries the same metadata for pending, running, and finished missions, so each chip can surface identical details regardless of state.
| } | ||
|
|
||
| data class DownloadUiState( | ||
| val chipState: DownloadChipState = DownloadChipState.Hidden, |
There was a problem hiding this comment.
Can't there be multiple downloads at once for the same video? Why show only one of them?
There was a problem hiding this comment.
The repository/view-model now emit a list of DownloadEntrys keyed by their unique handle. The Compose surface renders all of them as chips and keeps the sheet focused on whichever entry was tapped.
| DownloadChipState.Downloading -> AssistChip( | ||
| onClick = onChipClick, | ||
| label = { Text(text = stringResource(id = R.string.download_status_downloading)) } | ||
| ) |
There was a problem hiding this comment.
I would show the same CompletedDownload information for pending downloads too. Just maybe show a different background, like it's currently done in DownloadActivity (with the bar-stripes background), so users can distinguish pending downloads from finished downloads.
There was a problem hiding this comment.
Pending chips now show the same name/quality details and apply the marquee stripe styling sourced from Utility’s color logic, matching the visual language used in DownloadActivity.
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDownloadStatusViewModel.kt
Outdated
Show resolved
Hide resolved
|
No worries -- just wanted to make sure I'm contributing in a productive way. Really appreciate the review + comments here.
Added KDoc over Addressed other comments above inline. |
ae87a09 to
a00e6e8
Compare
What is it?
Description of the changes in your PR
remember which videos were downloaded (with SAF URIs, quality label, etc.)
healing (video-open probe, downloads-screen refresh, periodic WorkManager job)
present
Before/After Screenshots/Screen Record
new mission.
described above. (No visual regression screenshots attached.)
screen-20250916-223018.2.mp4
Fixes the following issue(s)
Relies on the following changes